/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package samoloty.view;

import java.awt.Font;
import java.awt.Point;
import javax.swing.BoxLayout;
import javax.swing.JScrollPane;
import javax.swing.UIManager;

/**
 *
 * @author borysfan
 */
public class HelpPanel extends ContentPanel {

    private MyLabel title;
    private MyTextArea text;
    private JScrollPane scrollPane;

    public HelpPanel() {
        super();
        initPanel();
    }

    private void initPanel() {
        title = new MyLabel("HELP:");
        title.setAlignmentX(CENTER_ALIGNMENT);
        title.setBold();
        title.setPosition(new Point(250,0));

        text = new MyTextArea();
        text.setColumns(63);
        text.setLineWrap(true);
        text.setRows(18);
        text.setWrapStyleWord(true);
        text.setEnabled(false);
        text.setFocusable(true);
        text.setBorder(null);

        //setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
        setLayout(null);
        add(title);

        //UIManager.put("TextArea.font", new javax.swing.plaf.FontUIResource(new Font("monospaced", Font.PLAIN, 14)));
        scrollPane = new JScrollPane(text);
        scrollPane.setBounds(2, 20, this.getWidth() - 4, this.getHeight() - 4);
        scrollPane.setBorder(null);
        add(scrollPane);

        initText();
    }

    private void initText(){
        String t =
                "BI - BASIC INDEX - index at Basic Weight\n" +
                "DOI - DRY OPERATING INDEX- index at Dry Operating Weight\n" +
                "DLI - DEADLOAD  INDEX - index at cargo compartment loaded\n" +
                "DLMAC - DEADLOAD MAC - % MAC at cargo compartment loaded\n" +
                "LIZFW - LOADED INDEX at ZERO FUEL  WEIGHT 	- index at ZFW\n" +
                "MACZFW - % MAC at ZERO FUEL WEIGHT - % MAC at ZFW\n" +
                "LITOW - LOADED INDEX at TAKE OFF WEIGHT - index at TOW\n" +
                "MACTOW - % MAC at TAKE OFF WEIGHT - % MAC at TOW\n" +
                "LILAW - LOADED INDEX at LANDING WEIGHT - index at LAW\n" +
                "MACLAW - % MAC at LANDING WEIGHT - % MAC at LAW\n";
        setText(t);
    }

    public void setText(String s){
        text.setText(s);
    }
}
